package ru.dc.object.commands;

/**
 * <pre>
 * User: Penkov Vladimir
 * Date: 11.10.2010
 * Time: 10:41:44
 * </pre>
 */
public class HubTopic extends Command {

    private String topic;

    @Override
    public String generateCommand() {
        return getActualCommandName()+" "+getTopic();
    }

    @Override
    public String getActualCommandName() {
        return "$HubTopic";
    }

    @Override
    public void parseCommand() {
        if (getCommand().length()>10) {
            setTopic(getCommand().substring(10));
        }
        else {
            setTopic(null);
        }
    }

    public String getTopic() {
        return topic;
    }

    public void setTopic(String topic) {
        this.topic = topic;
    }
}
